package com.ruoyi.common.core.utils.number;


import java.util.regex.Pattern;

/**
 * @description: 数字工具类
 * @author: Yuan
 * @create: 2025-02-25 19:36
 **/
public class NumberUtils {

    /**
    * @Description: 正则表达式判断是否是数字字符串
    * @Param: [str]
    * @return: boolean
    * @Author: Yuan
    * @Date: 2025/2/25
    */
    public static boolean isNumberString(String str){
        Pattern pattern = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
        return pattern.matcher(str).matches();
    }

}
